Adding logic for reading and writing bitmap file