Fixed a bug caused by removing IMASK_GRAY8