Transforming a sequence of images so that they match up geometrically