modified script to send pictures to s3