First of all, allocating the 2D array explicitly like this is not a good idea in terms of performance, since the memory is not contiguous. It's better to allocate it in one chunk of memory (unless it is too big), and abstract the 2D access, like most image processing libraries do (e.g. OpenCV).
That said, you should wrap this in a class that knows the size of the allocations, and then report the size with public methods.