add image support to templates