fixed page_index to advance when we click on a thumbnail from another page