Added pagination and small fix for making odd-ending images of larger size.
Pagination should now work with JSON as well.