Improve the handling for bitmap.