Fix for MEDIA-314 Uploading file with same name twice renames parent directory