Added image selection toggle code