Refactored code to make Bitmap Image reading reusable.

Intend to use it for reading bitmap textures