FIXED— I had a similar issue (media.php error) while trying to do a manual upgrade from 3.2.1 to 3.5. after several attempts to revert back to 3.2.1 ad i could not, i took the bull by the horn.
I suspected that wordpress 3.5 has a bug issue (thats for code wizards to sort, i downloaded wordpress 3.4.2.
uploaded it to my wordpress folder and replacing wp-admin and wp-includes.
I checked to see that all files i uploaded with 3.5 are deleted.
next i point my browser to mysite/wp-login/upgrade.php
i got a class them error this time.
next i copied wp-settings into my wordpress installation folder overwriting what was there.
them i cleared by browser cache ctrl + shift + del
and reload mysite/wp-login/upgrade.php and boom! my site was upgraded to 3.4.2.
I will stick with that for a while cause my site https://nigeriaoilandgasjobs.com was down for 3days becuase i wanted to upgrade to wordpress 3.5
I had to give something back because i learnt alot from your posts