fix mimetypes for html output
don’t rely too much on global variables