Previous and next buttons functions

added the functionality to move to the previous slide and to the next
slide