HG-416 Fix galleries in ADB

Galleries view was broken when some images had caption and some didn't. Adding one line and align `figure` elements vertically helped.