Improved handling of permission errors with the medium-folder