Fix warnings in logs when renaming over the web UI

The determineIcon() method was expecting attributes to be set which
caused warnings about undefined indices in the error log.

This fix pre-initializes the array with 'directory' and
'isPreviewAvailable' to make them disappear.

Seen in #6975, @raghunayyar please try this branch and let me know whether that fixes your issue.

Please review @karlitschek @DeepDiver1975 @schiesbn