this stuff should only apply to image attachments. will have to deal with other types separately