The image() Object
The subject of creating an image on the fly seems to have at least a couple of approaches. An image <img> element can be created or an image() object constructed.
Images are an important part of a webpage and it is normal to hard-code them in the pages. However, in the case of a slideshow or presentation the image files can be quite large and it doesn't make sense to pre-load them all when the page is created.
In my example I will create an image object from an array and attempt to replace that image with another from the same array.
I am not sure I like the method of deleting - what happens to the first image object?