Fixed LightToDark bug in threshold crossing function of ImageClass