trying to write script to swap image