Well there you have it, British nationals in prison have risen just under 10,000 in ten years so take off the 10,000+ foreigners as you stated and we are back to the British nationals figure of 2004 when we did not need more prisons.
Not that simple though is it. There were nearly 9000 foreigners in prison in 2004. You would have needed to deport all of them for your maths to work.