Two different ways exist using $n and using $hn. This first you have to restart the numbering stream, the second restarts automatically after a Page Break.
If your Chapters and Sections are numbered in the Titles, you need to use a “#” in the code, so they don’t increment. The number of the Image you use a colon “:”, so it increments when you use it.
I use:
For the chapters: Chapter <$n:chapter> - Chapter name
For the sections: Section <$n#chapter>.<$n:section> - Section name
For the images: Figure <$n#chapter>.<$n#section>.<$n:figure:ImageName> - Caption text. (ImageName without spaces must exist for this number to increment)
Restart the Sections and Figures in the Chapter Prefix: <$rst_section><$rst_figure>
Restart the Figures in the Sections: <$rst_figure>
When you use $hn for your Titles, you can do the same, but you don’t have to restart the numbering for chapters and sections. This way it seems not possible to restart the Image Numbering Stream, so if you want 2.3.1 for the first Image in the next Section, it will turn out to be 2.3.4.
[Edit] Actually, the reset not working in Sections or Chapters is also the case in the first way of numbering, using $n. If someone knows how to circumvent this, please let me know. [/Edit]