Fix of src attribute population

Only fetch the value of `href` attribute if the `src` attribute of `img` tag is `undefined`