rewrote function for communication to server: string data is being received server-side but image data is not