Handle Filetypes by libmagic instead of relying on file extensions