Working mbuffer with dynamic allocation of image data