fix template issue, added alt for img tag, checked undefined