Updated to more safely generate mimetypes file