Fixed MIME type truncation on embedded images

Except for png, the data URIs for images were being written like
data:image/mp, data:image/pg, data:image/if instead of bmp, jpg, gif.
Merge pull request #23 from ap0state/bugfix

Fixed MIME type truncation on embedded images