<div class="quoteheader"><div class="topslice_quote">Quote from: http://www.d20pfsrd.com/classes/core-classes/wizard</div></div><blockquote class="bbc_standard_quote">To learn, <span class="bbc_u">prepare</span>, or cast a spell, the wizard must have an Intelligence score equal to at least 10 + the spell level.</blockquote><div class="quotefooter"><div class="botslice_quote"></div></div>So no he couldn't prepare spells while imprisoned, but you are right in that you retained the spells you had while being pulled through the portal, and regained the ability to cast them when your Int was restored.