Forgot to say, a workaround is to get your script to populate the database directly. Restart the backend afterwards. You need a separate "Photographs" group for each dir in the storagegroup table.