fix bug in writemime

A couple of us in #julia were having problems getting images to display in IJ notebook. This fixes it.