wrap_figures: Replace with bs4 to avoid mangling and postprocessing.

lxml breaks things like "|filename|" by escaping them,
bs4 seems more tolerant of invalid html and leaves it alone.