some code cleanup
splitted find extreme pixels methods
simple threshold method
implemented asynchronous thresholding
tried to view thresholded image but it fails with plain white display
Aldo added fix for openGL grayscale image