Changed mime type detection to use PHP native function not wordpress as sometimes returned NULL
Comment out console.log()