[BUGFIX] Also consider JPEG files for IM/GM