CAS-13898 : Fix memory allocation per-plane
The previous fix to pass in the available memory into auto-multithresh
did not work as expected, because the per-plane memory budget never
exceeds the total.
This fix divides the total memory budget by the estimated number of
planes used in the algorithm, and passes that in to the Lattice images.
This correctly seems to restrict the memory usage.
From initial benchmarking, memory limits are now respected as expected.
CAS-13898 : remove unnecessary temp image allocs
Removed two temporary images that have memory allocated but are never
used. This seems to have brought down total memory usage by 20-30% for
auto-multithresh.