use file name to check if file exists, fixes #1032
Merge pull request #1034 from modilabs/media_hash_fix

use file name to check if file exists, closes #1032