make sure it works for s3 based attachments as well.