Don't read file twice in sanitized_file

This can cause excess extra traffic and memory usage, especially with
fog. Also remove what seems to be a useless read in the if block and
added some initial specs for sanitized_file.
Merge pull request #1476 from felixbuenemann/fix-sanitized_file-double-read

Don't read file twice in sanitized_file