I would recommend to use Flatpak package.
As far as I know, GIMP 3.0.4 Flatpak was built against libheif 1.19.4, Shotwell 0.32.13 Flatpak was built with latest libheif 1.20.1. But I don’t know which for EOG.
If you want to get recent libheif for default apps, there’s only 3rd party (unofficial) packages available. And here’s blog post talking about it.