changed the way it swaps with images