calgray: fix getRgbBuffer problem

This fixes issue 3903.