Retain type safety by using const_cast instead of C-style cast
Make GetMimeType() more effective by always resolving MIME types for known extensions

Before, the MIME type would only be resolved if the lookup param was set to true, which is potentially blocking. Now MIME types can be resolved from extension without possibly blocking the thread.
Fix IsAudio|IsVideo|IsPicture() incorrectly returning false when the MIME type helps determine the media type