My choice is either simply to implement a direct 'click to illustration' facility and then publish, or just publish as is. The Calibre route produces mobi output which seems to work fine on the Kindle Previewer, and the KP will also translate epub Calibre output back to mobi and show that pretty ok too.
I'm not using images as chapter headers, I just want to say "...as shown in fig. 5.1..." for example, and allow them to click on 'fig. 5.1' to get to it.
A regards the code you show, I have tried to get to the bottom of TOC but no explanation I've seen ever seems to make full sense. Calibre seems to produce what's required automatically, and as I say, trying to use the grammar in what seems to be the TOC section in my code doesn't do what it should do. Do you know why?
I do have everything (except images) all in the one html file, but my TOC section starts:
as you show.