There have been some suspect manipulations in our media library (for example, detaching and reattaching of images), such that we now have images in our library which are linked to the wrong template. So far, we have found instances of PNG images using the JPEG template.
For most browsers, this doesn't cause a problem. But we are using the X-Content-Type-Options: nosniff
HTTP header and have found that one old browser that we still need to support (namely, MSIE) will then refuse to display the image since it is sent with a JPEG content-type.
Does anyone know of a way (ideally a Sitecore PowerShell script) of detecting these cases of "wrong extensions" across the entire media library? We're mostly interested in JPEG <--> PNG
cases.