> I wouldn't have to put my pictures in separate arbitrary folders when they fit in two categories, without duplication.
You can already do that, either using hard links or symlinks. Personally I find hard links to be more interesting, as it looks like a normal file but you can "delete" the file from one side and the data will remain.
As for figuring out where the storage is going, this is a common object database question funnily enough. Usually you have a root object that knows a bunch of other top-level objects. So enumerating over everything is possible through that. Assuming there is a good enough garbage collector, there won't be any stray files/objects which aren't referenced.