Setting vertical slide to first or last when navigating to the next or previous slide