added swapping of 2 images, needs to be generalized