Thanks for the logs. The fact that it only happens sometimes indicates that the problem is probably in the scanner side while downloading the file.
Any chance you’re running out of space in the device resulting in truncated files?
Also Is there anything particular about your network configuration that could result in modified files?