Hi,
This might not be the solution.But i dint understand why are you lopping through the whole grid and getting reference of all image buttons?Correct me if i am wrong.
On the image button click, get the reference and change the url of that button.
Like,this in C#.Iam not sure how it is in VB.
ImageButton ibtn1 = sender as ImageButton;
Hope this helps.