managing the bitmaps memory