Html captions not being wrapper properly

The way the current html captions were being set would results in duplicate 'p' tags. This commit fixes that issue.