Fix: EZP-22021: legacy images naming, rebooted

Reboot of https://github.com/ezsystems/ezpublish-kernel/pull/638, that fixes https://github.com/browse/EZP-22021.

Fixes the way the image path is generated, this time by really doing what is documented.

### Note about the patch

The PR contains two commits, one that reverts (completely) the previous fix, and another one that re-does it, with corrections. This will make it easier to ship the patch to those that require it by having a totally independent patch.