Added improvement to function that reads the bitmap image.