Dear Fred,
I've just updated the script to deal with the logging issues you were having though the addition of a 'logverbose' parameter. I've also tested with two courses containing some identical images in the same section numbers including '0' and it works.
Cheers,
Gareth