JPEG: improve detection