corrected null pointer exception error if mimetype is not known (=null)