*/
protected function outputResults( $out, $skin, $dbr, $res, $num, $offset ) {
if ( $num > 0 ) {
- $gallery = new ImageGallery();
+ $gallery = ImageGalleryBase::factory();
+ $gallery->setContext( $this->getContext() );
# $res might contain the whole 1,000 rows, so we read up to
# $num [should update this to use a Pager]