Detect mime type