Added better MIME detection