Moving and repeating

Hi; I’m currently writing a script that will allow me to import images that have had their locations stored in an xml file as well the images will move as though they are on a film reel and repeat once they have come to an end of the images; as well as several other thing. However I’m having problems figuring out the script that will allow the images to move on their own and have them repeat. Is this just something simple that I’m over looking?
My current version can be found here