Added full gallery support with pagination