在mediawiki锚链接与HTML内容中的img标签不完美

I am new to mediawiki and am using html content to view the image , I need to get image with anchor tag . I created the code but it will not shown the image, Its just display the code itself.

$fullPageHtml = Html::openElement('img',array('src' => '/mediawiki/images/god.png',
                                         'alt' => 'alt'));
$fullPageHtml .= Html::closeElement('img');

If i make a space after the "alt" tag , when i use firebug it will show the image but otherwise it won't. Any solutions

Harsha's answer: wrap the HTML in the addHtml() function instead of Html::openElement().