Saving jpeg and dicom to Amazon S3