Adding error checking when getting images to attach.

Signed-of-by: Brian Caruso <briancaruso@gmail.com>
Adding headers to attached images
fixing bug with html modification for CID

signed-off-by: Brian Caruso <briancaruso@gmail.com>