Check for <img> alongside textContent when detecting empty nodes