Complete implementation of new getMimeType method to circumvent issues when php fileinfo is not loaded on server