Add stepinterval, stop animation and loop

Add functionality for step in interval. Modify to stop animation when buttons are clicked. Added a loop functionality .

Pay attention that loop functionality works well when the step and
number of images visible are consistent.