blockproc() need not return an array the same size as the nominal input window. It would be valid, for example, to tell it you want a 1000 x 1000 window, but then when you get the data, extract only the first 11 x 11 pixels from it.
But if it is just a matter of removing the 0 pixels, then you can
horzmask = any(TheImage, 1);
hfirst = find(horzmask, 1, 'first');
hlast = find(horzmask, 1, 'last');
vertmask = any(TheImage, 2);
vfirst = find(vertmask, 1, 'first');
vlast = find(vertmask, 1, 'last');
subset = TheImage(vfirst:vlast, hfirst:hlast);