calgray: fix getRgbBuffer problem

Fixes #3903