Improved and changed CreateBitmap and ToGrayscale