Unrotating image before uploading to server