Added condition to slider not switch when have only 1 image