improve MIME type handling