The error message is very clear, its not valid in html to put a div inside an anchor, you can put an img element there instead to show an image.
Html has a lot of rules, especially xhtml. The first step is to understand what the correct xhtml output should be. There are quite a few good html reference books out there as well as many online resources to learn how to structure html. In a way ASP.NET is bad because it makes people think they can be web developers without any knowledge of html, because in many ways ASP.NET shields you from having to know html because it produces the html for you. ASP.NET is just a tool for producing html, it will generally produce correct html markup but it is still possible to produce incorrect markup especially when you are entering html fragments directly in a page or master page. Its trying to help you by throwing this error and telling you your html markup is incorrect.
Hope it helps,
Joe