util img: modify brightness contrast algo to apply brightness first

this allow to always have brightness between -1 and 1, as expected in the algo input
Also change contrast to depth**contrast. Doesn't change much in the values, but
simplify the reverse algorithm (as every case is supported).

also update the optimal b/c algo to reflect the changes. It simplies it too.
gui: update the image when the b/c is back to auto.