Fix valid bytes counting bug

A bug in JPG, PNG and MSOLE validators in which validating a file after
having validated a broken file could result in a wrong count of valid
bytes.