An error shows rarely iindex was outside the bounds of the array in line number 160





Line number 160 starts below.
Code:
         string s = "";
                if (imgname[pageno - 1, 0] != null)
                {
                    ImageButton1.Visible = true;
                    TextBox1.Visible = true;
                    ImageButton1.ImageUrl = image_url + imgname[pageno
...