fixed bug in demosaic