Analysis attachments cause error compiling results email

Fixes #1096