Fix problem where security warning was displayed for valid images with image/jpg type (#1489097)