jQuery function only affecting one img out of 3
<p>This is a follow up from a question I asked earlier but although mostly working now, the function is taking the first of 3 images as it's reference to <code>addClass()</code> and not following the <code>if / else</code>. Any idea why?</p>

<p>Image 1 &amp; 3 = Landscape - correctly adding <code>.heightDefine</code></p>

<p>Image 2 = Portrait - incorrectly also adding <code>.heightDefine</code> instead of <code>.widthDefine</code></p>

<pre><code>jQuery.fn.galDisplay = function () {
    var galSingleImgH = this.height();
    var galSingleImgW = this.width();
    if(galSingleImgW &gt; galSingleImgH){
        this.addClass('heightDefine');
    } else if(galSingleImgW &lt; galSingleImgH){
        this.addClass('widthDefine');
    } 
}
jQuery('.notFirst img').galDisplay();
</code></pre>
