getPreviousHash() now checks if a file with the found hash exists and will otherwise search for a matching file