title: Instagram Receiving the same images via pagination
body: <p>I'm trying to work with the Instagram API, but seem to have hit a bump that I can't get past. Here is the code I'm working with:    </p>
  
  <pre><code>private function getInstagram()
      {
          $images = array();
          if(SERVER == 'test'){
              $tag = 'dog';
          } else {
              $tag = 'cat';
          }
          $url = "https://api.instagram.com/v1/tags/{$tag}/media/recent?access_token=".INSTAGRAM_ACCESS_TOKEN;
          $instagram = json_decode(curl_get_contents($url));
  
          for($x=0; $x &lt; 7; $x++){
              if(is_array($instagram-&gt;data)){
                  foreach($instagram-&gt;data as $pic){
                      $images[$x][] = $pic-&gt;images-&gt;low_resolution-&gt;url;
                  }
                  $newUrl = $url .'&amp;next_min_id='.$instagram-&gt;pagination-&gt;next_min_id;
                  $instagram = json_decode(curl_get_contents($newUrl));
              } else {
                  break;
              }
          }
          return $images;
      }
  </code></pre>
  
  <p>For some reason I keep getting the same 7 images returned even on subsequent calls using the next_min_id. Does anyone see anything that I'm doing particularly wrong? Thanks.</p>