whitening code fix for colored images