firstChild bug fix

Safari, Chrome and Firefox treat space as HTML element. This is why img
should be right after div tag, otherwise firstChild returns text
element.