Here is your code back. I flattened the logic out a bit by removing all the unnecessary case structures and sequences (all multi-frame sequences are unnecessary). I also connected up the error clusters and brought it out to a front panel indicator so you can tell if an error was being generated--which there was...
I can see where you are bringing in the image to process, but the code apparently also needs a template image and I don't see you loading in the template. The error message is that the template image is too small.
Always, always, always connect-up the error clusters. Most high-level routines (like IMAQ) will tell you when a problem occurs if you let them.
Mike...