Use python's mimetypes to determine file type