update slides and slide index