Im back at this with an "almost there" update
https://piwigo.org/ext/index.php?eid=966
Now I can add the red background rectangle with the image id but I'm not able yet to put it in the bottom right of the image, now its shown at the correct height at the bottom but outside of the image.
I can use some help here. Thanks!!
PS: this time with the help of Claude Sonnet 3.5