[Olena-patches] milena r1630: Fix convertions between the 4 graylevels types