usage of function <addImageToTemplate>