add checking of actual mime type (rather than reported)