added navigation buttons to show the next and the previous image
do not give the focus to the overlay buttons
fixed indentation
moved check for null in the show_pointer function