added S3 support for attachments