added image 'threshold' slider, fixed several bugs