Set appropriate image mime type in data URI based on extension of embedded image.

Thx to JD for this suggestion.