Fix templates to display number of pages