Where do you change the format of an image that is already in the document? Because it seems that you never use the information stored in "nowimage".