User:Muchos/Snippets/How to simulate an infobox image caption

How to simulate an infobox image caption

The problem
It's easy to make an image caption for an infobox template:

The problem is the caption tag won't be displayed if the Image value is a gallery:

A solution: simulating the caption tag
Template

CSS

Now i can use the same wikicode as above for making an infobox with an image gallery and an image caption.