animation and looping of images working