Skip directories when creating hashes

This patch fixes a bug where directories were hashed by just skipping them.

Previously if input file list was:
file.txt
dir/image.jpg

Output was:
file-hash.txt
dir-hash/
dir/image-hash.jpg