zip and jpeg signature detection: do not log error if can't read the header and check file size first.