fix for python 3.x incompatibility in pagination

bootstrap_pagination tag throws `TypeError: unorderable types: NoneType() > int()` in python 3.x. Tested on 3.3.2