Fix pixel value overflow