Why return the image?  Isn't the input image modified to have the whitening applied?