ended loop and disabled next button after last picture