Wrong mimetype returned by getMimeType from Magento library #716

Fix the issue which is present in getMimeType function.
In some cases it would return an integer (constant) instead of a string, for example 2 instead of "image/jpeg"