Kwf.onElementReady('.kwcBasicImageEnlarge.showHoverIcon > a', function(el) {
    var img = el.child('img').dom;
    if (img.width > 50 && img.height > 50) {
        el.createChild({ tag: 'span', cls: 'outerHoverIcon', html: '<span class="innerHoverIcon"></span>'});
        if (img.width < 200) {
            el.addClass('small');
        }
    }
});

@@ -81,16 +81,18 @@
  var img
+El
  = el.ch
@@ -105,14 +105,60 @@
 mg')
+;%0A    if (imgEl) %7B%0A        var img = imgEl
 .dom;%0A
+    
     
@@ -194,24 +194,28 @@
 ght %3E 50) %7B%0A
+    
         el.c
@@ -311,16 +311,20 @@
 an%3E'%7D);%0A
+    
         
@@ -358,16 +358,20 @@
         
+    
 el.addCl
@@ -380,24 +380,38 @@
 s('small');%0A
+            %7D%0A
         %7D%0A  

Add if to ensure that el.child('img') is not null