Fix bug with corrupted PNG after string/binary conversion

Change the strategy: curl the image and convert directly, so we can handle
string variables and still not corrupt the image before inserting it into
the email body