1- Create an array of imageviews, lets call it igv. Then you refert o them as igv(1), igv(2),igv(3), etc.
2 -Create a function Sub Update (cup as String, ID as int) where you pass the parameters
now you can use only one line to call the function, passing the parameters, let's say Update ("cup1",1), and by using those parameters you can change the imageview and the SQL
I' haven´t much time at the moment to put this on code, but would make your program more manageable, and also I did not understand if this is what you are looking for.