Better mimetype detection

Added better mimetype detection for those users who havent installed the fileinfo extension.