Added typecasting total_pages to int instead of float when recalculating

Signed-off-by: Derek Myers <arcticpro@gmail.com>