Updated code for #11 and #87.  #87 also removes image tags before scanning.