code cleanup, variable-size NCC, auto-cropping of large imgs