Updated to be able to create attachments in multiple formats