Aiqiu,
I am glad you found out about flattening your image to a string. I was about to post and say that you probably didn't want to save the IMAQ image reference to a file, because after you closed the image in memory, there wouldn't be anything for the IMAQ image reference to point to. You are correct to flatten the image to a string. Below is a link to a document which discusses doing this to communicate over datasocket, but the processes of flattening the image to a string is the same regardless of whether or not you are sending the image across a datasocket connection or saving to a file.
As for the memory leak. I am pretty sure that if you passed all of the IMAQ Image references created in the "Image Init Buffer.vi" subVI and then closed each reference individually, that the memory leak would probably go away.
Lorne Hengst
Application Engineer
National Instruments