more html cleanup, also added "addImage to thtml"