added image switching method