routine insertion should be called when images are loaded