Add text to image path when image has unique id in htaccess

I have a multilingual website. This website has over 10.000 images in different articles and growing.

I need to be able – if possible – to random rename the images as long as the unique image-id is also displayed in the end.

Lets take this image for example: gallery_964/15471298.webp

I would like to be able to use the image like this

<img src="gallery_964/green-elephant-15471298.webp" /> //english
<img src="gallery_964/elefante-verde-15471298.webp" /> //portugese
<img src="gallery_964/grøn-elefant-15471298.webp" /> //danish

I have tried the following which did not work

RewriteRule ^.*(d+)gallery_964.(jpg|gif|png|webp)$ /gallery_964/$1.$2

I really can’t figure it out at this point. Is it even possible?