function plotStackIm2(D, dim, IMG_H, IMG_W)

figure; 
% ha = tight_subplot(1, size(D,2),[.01 .03],[.1 .01],[.01 .01]);
ha = tight_subplot(1, size(D,2), [.01 .01],[.01 .01],[.01 .01]);

for i=1:size(D, 2)
       axes(ha(i)); 
       dd = D(:, i);
       dd = reshape(dd, IMG_H, IMG_W); 
       imshow(dd,[]);
       pause(.01);
end