You need to have a panel inside your body and give it some id.
<body>
<asp:Panel id="panel_holder" runat="server">
</asp:Panel>
</body>
and then in code behind
HtmlGenericControl div = new HtmlGenericControl("img");
div.Attributes.Add("src", "image_location");
panel_holder.Controls.Add(div);