Problems seen in sending image functionality

comments in code describe problems