JPEG images can include an embedded thumbnail image, along with the camera/software metadata.
Sometimes the thumbnail doesn't match the full-size picture (because it wasn't updated after editing, or because of shenanigans).