Bluetooth HC 05 Programming Reviving 32 bytes of Data

I want to Transmit the Picture through HC 05 (Serial Bluetooth Module )Module.. but I cant Get proper data @ receiving side. @ sending Site the 32 bytes of data send Properly.. using Serially
but at receiving side i am getting problem to receive the data.. the Data get Delayed.

here is the code for Receiving end..

myFile = SD.open("pic.jpg", FILE_WRITE);
while(!EndFlag)
  {
    j=0;
    count=0;
    delay(5);
    while(mySerial.available()>0)
    {
      incomingbyte=mySerial.read();
      k++;
      if((j<32)&&(!EndFlag))
      {
        a[j]=incomingbyte;
        if((a[j-1]==0xFF)&&(a[j]==0xD9)) // Picture finish
        EndFlag=1;
        j++;
       count++; 
      }
     }
 
 
    for(j=0;j<count;j++)
    {
      if(a[j]<0x10)  Serial.print("0");
      Serial.print(a[j],HEX);           // observe the image through serial port
      Serial.print(" ");
    }
    for(ii=0; ii<count; ii++)
      myFile.write(a[ii]);
    Serial.println();
  }
  myFile.close();
}

here is the code for Receiving end..

Take your snippets to http://snippets-r-us.com.

Have a look at the examples in serial input basics

...R

OHK THANX