Use a cell array instead:
imgVNIR{1} = ...
imgVNIR2{2} = ...
imgSWIR{1} = ...
imgSWIR{2} = ...
Having millions of variables with incremental numbers is almost never a good solution to a problem and requires you to do gymnastic with the Matlab language to achieve it. Then when you have created them you have to do something with the mess of variables you have created instead of just a single (or a few) nice cell arrays that you can numerically index into in a single easy statement.
I just glanced at your specific problem, but if all your results are of the same dimension then it is also possible you can just use a numeric array of dimension n + 1 (for results of dimension n) and index into that using the n th dimension to retrieve the result you want. This will be faster to execute than a cell array, but is slightly less intuitive to use (in my opinion).