fix rgb_to_hsv conversion so that it does not return nans