Hi. I was able to add this feature to my wiki (after I asked for help). You can check here how it works : https://wikirouge.net/Journ%C3%A9es_de_juillet_1917
NOTE that it is not possible to add links in the caption (the parser breaks it) but this is not specific to this feature.
HOW TO DO IT ? Well, I can give you the two files (this one and this one) that have been modified, but I have not kept precise information about which lines precisely have been changed... I should compare with last version on github (because my files are differents due to some tweaks I made) and make the commits, but I think I'll never have the time. Anyway, I hope it will be useful to someone.
NOTE that the mediawiki/plugin.js file in the link above is also affected by changes related to this tweak.