Need to put all your images in the same directory structure that Magento uses? Put all your images in the same directory and enter this:
for i in *.*; do mkdir -p ${i:0:1}/${i:1:1}/; mv $i ${i:0:1}/${i:1:1}/; done;
Which will move all your images into different directories depending on the initial 2 letters of the image filename, for example, askmatt.jpg will be moved into a/s/askmatt.jpg. New directories will be created if necessary.
