I didn't receive an error at all. The function does the same thing as the For,Next loops. It uses a multi-dimensional array just as they do, but rather than have three For,Next loops like my code has, you can replace all three with:
RotateImagetoArray(redblock,0) RotateImagetoArray(greblock,1) RotateImagetoArray(blublock,2)