fixed gallery and test to improve pagination