function ajax_photoset($id, $page = 1)
    {
        global $phpFlickr;
        $pager = new phpFlickr_pager($phpFlickr, 'flickr.photosets.getPhotos', array('photoset_id' => $id, 'extras' => 'media'), get_option('fg-per_page'));
        ?>
			<div class="flickr-photos">
				<?php 
        foreach ($pager->get($page) as $key => $photo) {
            ?>
					<div class="flickr-thumb">
						<a href="http://flickr.com/photo.gne?id=<?php 
            echo $photo['id'];
            ?>
"><img class="<?php 
            echo $photo['media'];
            ?>
" title="<?php 
            echo str_replace("\"", "\\\"", $photo['title']);
            ?>
" alt="<?php 
            echo str_replace("\"", "\\\"", $photo['title']);
            ?>
" src="<?php 
            echo $phpFlickr->buildPhotoURL($photo, 'square');
            ?>
" /></a>
					</div>
				<?php 
        }
        ?>
				<div class="fg-clear"></div>
			</div>
			
			<?php 
        if ($_GET['pagination'] && $pager->pages > 1) {
            ?>
				<div class="clear">
					<?php 
            if ($page != $pager->pages) {
                ?>
						<div id="photoset-<?php 
                echo $id;
                ?>
-<?php 
                echo $page + 1;
                ?>
" class="flickr-gallery-next" style="float: right"><a href="#"><?php 
                _e('Next Page &rsaquo;', 'flickr-gallery');
                ?>
</a></div>
					<?php 
            }
            ?>
					<?php 
            if ($page != 1) {
                ?>
						<div id="photoset-<?php 
                echo $id;
                ?>
-<?php 
                echo $page - 1;
                ?>
" class="flickr-gallery-prev" style="float: left"><a href="#"><?php 
                _e('&lsaquo; Previous Page', 'flickr-gallery');
                ?>
</a></div>
					<?php 
            }
            ?>
				</div>
			<?php 
        }
        ?>

		<?php 
        exit;
    }
 function call_flickr_api_with_pages($page = 1)
 {
     $per_page = $this->args['per_page'];
     unset($this->args['per_page']);
     $pager = new phpFlickr_pager($this->flickr, $this->method, $this->args, $per_page);
     return array('photos' => $pager->get($page), 'total' => $pager->total, 'pages' => $pager->pages);
 }