i've stored 1M+ images locally (pr0n spider, thank you). i split them up into directories of 10,000 images each based on a primary key calculated by a simple int(id/1e4). doing things like df -h took FOREVER, but i didn't have any major problems. filesystem was ext3 on a standard 7200rpm ide drive.
perl -e'$_="nwdd\x7F^n\x7Flm{{llql0}qs\x14";s/./chr(ord$&^30)/ge;print'