use unlink() to remove stale symlinks instead of using the filesystem instance as the latter one uses file_exists().