Fixed bug in deleting unused photos

... and wow, my tests were really not testing what I thought they were
testing :-/