Added file renaming functionality. If a file is uploaded, and there is a
filename clash in the target directory, the file will be renamed.
Example: summer.png, if uploaded to a directory that already contained a
file with the same name, would become summer-1.png. Uploading yet another
summer.png would cause the file to be renamed to summer-3.png, and so on.