Why do you want to post it in avif? My problem was you just linked it from reddit, and haven't uploaded it somewhere else. I can't open it because it's linked from reddit, not because it's not avif. There are countless image hosts, a lot people use https://catbox.moe/ for example, and it won't convert it to any other format.
For posts you are right, the default webui wants to open them as links, but in Voyager they are embedded correctly. This is temporary, as support for avif was already added in January, it will work in the future, I guess in the next release: https://github.com/LemmyNet/lemmy-ui/pull/3738
In comments avif already works everywhere.