Implemented synchronizing images and looping through images