Support for generic attachments, not just images.
Add lib/attachment.py, for attachment-related functions