more intelligent mimetype inference