Remove wrapping <p> around <img>

Changes to the formParagraphs functions to remove wrapping <p> around
<img>.