I am not used to tweak a lot my stylesheet, and probably I did this mistake. I agree that the detailed implementation you just gave me is both good and shorter.
I take good note of it. The standard procedure used by
writer2xhtml works well for standalone images but should be improved for repetitive images to keep a compact code. These ones should be treated in a slightly different way.
I will submit a proposal to the author to take care of this.