Fixes rotation script and hence uploads for PHP <5.3
Fixed image upload issue