Integrate fixes from #238.

I was already working on #228 and had published a partial fixe
yesterday. I integrated the Jeff’s fix from #238 and added rules to
account for bare images/text.