fix 2D images for spam-ldic (flatten +1 in z in grid.py). Auto margin now base...

fix 2D images for spam-ldic (flatten +1 in z in grid.py). Auto margin now base on min dimension and not max
5 jobs for master in 24 minutes and 9 seconds (queued for 1 second)