resize image before uploading