passing image data to upload method