issue #77 - moved the mime lookup out of the filetype loop