Add index on page_name to pages, fix page number in pagination (support #366)