without digging into your logic / what you are trying to do -- if you want to pass the array by reference (which you should), you need to declare it properly:
(from http://stackoverflow.com/questions/7902433/passing-array-arguments-by-reference)
char & x[5] // declare x as array 5 of reference to char (not valid C++!)
char (&x)[5] // declare x as reference to array 5 of char
in this case, i think the compile interprets this as an array of ofImage references, vs. a reference to an ofImage array....