Hi Raúl--
You might be able to use the htmlimginserthook to tackle this problem. I haven't used it myself, but the description sounds like it would fit your use case. Look at the documentation for this feature and try it to see if it gives you the control over image naming that you need.
--Clay