Added checks on php upload errors and other edge case issues that prevent successful uploads
Added what is probably a very hacky method for versioning filename collisions ala wordpress. Will refactor this later!