I think it should be good checking `element.nodeName === 'IMG'` before getAttribute()