Rewrote ending after implementing simple sync of images