Tweak styles for "popup" image caption in viewer

Give ``<figure>`` relative positioning, so absolutely positioned
``<figcaption>`` is at top of the figure and not its parent.

Add margin so caption follows padding around image.

Addresses #717