Adjust heuristic to not go over soft limit of 3GB.
jindent
Corrected implementation of heuristic.
misc for the calculating the image bbox
Merge remote-tracking branch 'origin/master'