I am not sure since when this is broken, perhaps also in 3.1.x and 7.9.x
1) Start up testsuite project
2) Take a look at hippo-testsuite/content/src/main/resources/democontent/demosite-gallery.xml and check the h:merge="combine" is there
3) In the console make sure auto export is enabled
4) at http://localhost:8080/cms/console/?1&path=/content/gallery/images/nopic.gif/nopic.gif/demosite:largethumbnail change the height and write changes
Now check demosite-gallery.xml and see the h:combine is removed.
I tested latest 10.2 and in there it is also broken.