fix switch images functionality