Navigate through the gallery using the back and forward buttons.