Fix mimetype detection

@DeepDiver1975 @VicDeo 

Fixes #5516
Refs #5474