core: fix for mimetypes where 'image/jpeg' returns preferred extension '.jpe' (instead of '.jpg')
(cherry picked from commit b423c54e4ee90848c132eabf9f39ce1bb1d45a05)