title: Change image src by clicking on it -> to a src from the following thumbnail
body: <p>I'm, tying to swap an image <code>src</code> from a main/single image by clicking on it to a <code>src</code> from the next following thumbnail.</p>
  
  <pre><code>&lt;div id="productinfoleft"&gt;
    &lt;img src="images/product_images/info_images/some_image_0.png" class="productimage"&gt;
    &lt;div class="morepics"&gt;
      &lt;div class="active"&gt;
        &lt;img src="images/product_images/thumbnail_images/some_image_0.png"&gt;
      &lt;/div&gt;
      &lt;div&gt;
        &lt;img src="images/product_images/thumbnail_images/some_image_1.png"&gt;
      &lt;/div&gt;
      &lt;div&gt;
        &lt;img src="images/product_images/thumbnail_images/some_image_2.png"&gt;
      &lt;/div&gt;
      &lt;div&gt;
        &lt;img src="images/product_images/thumbnail_images/some_image_3.png"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>By clicking on the thumbnails I can already swap the main image - so far so good. But on click on the main image I'd like to change the image to the next file of the following thumbnail pool. The jQuery code I use right now is:</p>
  
  <pre><code>// BOF PRODUCT-MORE-PICTURE CLICK SWAP
  $('.morepics div:first').addClass('active');
  
  $(document).ready(function(e) {
    $('.morepics img').click(function(e) {
      e.preventDefault();
      $('.morepics div').removeClass('active');
      $('.productimage').attr('src', $(this).attr('src').replace('thumbnail_images/', 'info_images/'));
        $(this).parent('div').addClass('active');
      });
  
      var imgSwap = [];
      $('.morepics img').each(function() {
        imgUrl = this.src.replace('thumbnail_images/', 'info_images/');
        imgSwap.push(imgUrl);
      });
      $(imgSwap).preload();
    });
  
    $.fn.preload = function() {
      this.each(function(){
        $('&lt;img/&gt;')[0].src = this;
      });
    }
  
    // EOF PRODUCT-MORE-PICTURE CLICK SWAP
  </code></pre>
  
  <p>I have no clue how to change or extend my jQuery code to get this done also with a correct class change of the thumbnail div's to <code>active</code>. Any help would be really great - thank you.</p>