Cropping of image before uploading to server