Added ceil to total_pages

Added ceil function to total_pages calculation.