Add the id attribute to your img like this
Server side you can access it through its id
Also, don't concatenate table(s) in the code, use asp:Repeater and put your templated header and row into its placeholders and then fill the data in suitable events (RowDataBound or whatever you need). You can even do this in the template and it will be filled with DataSource data:
Google
asp:Repeater[
^]