moved loopImages() to front