Check if element does not exist

Check if element does not exist

I'm trying to check if an element doesn't exist & if it doesn't then hide a parent:

  1. $('#imagepackwrapper div[id^="packimgdiv"] img.imageStyle').each(function(i) {
  2.       var ick = $(this).length;
  3.       console.log('Exists: ' + ick);
  4.       if ($(this).length == 0) {
  5.         $(this).closest('div[id^="packimgdiv"]').hide();
  6.       }  
  7. });

The console is only detecting those with a length of 1.
How do I detect when the image is not in dom?
 
HTML:

  1. <div id="imagepackwrapper">
  2.   <div id="packimgdiv0">
  3.     <div>
  4.       <img class="imageStyle" >  // sometimes this image will be missing from dom
  5.     </div>
  6.   </div>
  7.   ... other packimgdiv's
  8. </div>