1 cubic foot is 1728 cubic inches
the 30" by 30" space is 900 cubic inches per inch of width
1 cubic foot is about 7.5 gallons
So... every 2 inches of width would be about 7.5 gallons, or 3.75 gallons per inch
The picture looks like over a foot of space to be had... or around 40 gallons, like your guesstimate.
