generate a PNG thumbnail for image attachments