just for my understanding why did we need to change img.src to img.getAttribute('src') here?