Added pagination to gallery