I think you want to set the `src` before you insert it into the DOM. I have no rational basis for this comment, it's just always how I do it, I think.