fixes #585

Moved genStdThumb function, refactored uploadify and upload to use the
same function. cleaned up some extra crap that was going on for no
reason.
fixes #316

Replaced thumbnail creation infinite memory limit to 100M to prevent
susohin alerts and avoid massive memory issues.
fixes #585

Missed in commit 4b1cb36857bf56085bf15ca722872329d94c97f3