fallback to the mimetypes module if magic isn't available because magic is difficult to install on windows