Use mime-types instead of filemagic