regarding e dot a dot schultz at gmail dot com post
i tried the script (with the bugfixes posted later) and still got memorytrouble. most often it is still not enough memory to upload big images, even if it seems to calculate right. so this helped my perfectly:
$newLimit = $newLimit+3000000; (before passing it to the ini_set() function).
extremly simple and maybe not the best solution, but it works for now (you sure can give it less than an additional 3mb, just try what works for you).