You need to rewrite the nonlinear Lev-Mar fit so the fit funtion operates on the entire array, instead of one point at the time and everything will be much easier.
Then simply reshape your 2D gaussian data and model function to a 1D array of size (x*y) and fit as usual.
To get you started we've done some of the work for you: 🙂Quite a while ago, David Thomson, Don Wagner and me had some discussions about improving Lev-Mar.
David has distilled a version and posted it on his site at the following link:
http://www.originalcode.com/programs_scientific.html
Look for the section "Nonlinear Fit", Version 2 (version 1 would not help much).
I have worked out a much more elaborate versions but the above should get you started.