A customizable Android and iOS/iPadOS WhatsApp database parser that will give you the history of your WhatsApp conversations in HTML and JSON. Android Backup Crypt12, Crypt14, Crypt15, and new schema supported.
I'm not a web developer but I did some quick research and maybe all we need to get the lazy loading is add a tag to the images as documented here: https://www.w3schools.com/tags/att_img_loading.asp
Only Safari doesn't handle this tag.
Also while commenting on things that I don't really know, maybe you could consider using the base tag in your HTML? Maybe you have a reason not to use it or maybe it's just me but my links are pretty long like this:
<a href="AppDomainGroup-group.net.whatsapp.WhatsApp.shared/Media/Profile\6590002603-1700006881.thumb"><img src="AppDomainGroup-group.net.whatsapp.WhatsApp.shared/Media/Profile\6590002603-1700006881.thumb" onerror="this.style.display='none'" class="avatar"></a>
with the base tag like this:
<base href="AppDomainGroup-group.net.whatsapp.WhatsApp.shared/">
you should be able to shorten the URLs to this:
<img src="Media/Profile\33610007857-1665000879.thumb">
Discussed in https://github.com/KnugiHK/WhatsApp-Chat-Exporter/issues/90
@jonx suggested: