for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
int itemid = Convert.ToInt32(ds.Tables[0].Rows[i][3]);
img.ImageUrl = "~/Handler1.ashx?id=" + itemid;
img.DataBind();
}
The reason is that you are looping through all the rows in a the dataset, and then setting the imageUrl to the last one every time. What you really need to ask yourself is Why are you using a loop if you only have 1 image on the row?