added code to resize image to make send successful