Get the proper middle of the gamma ramp when calculating the gamma correction

Signed-off-by: Mattias Andrée <maandree@operamail.com>