Fix issues with uploading images to S3.