Improve threshold everywhere for processing scans Closes #435 and #443 See merge request zesje/zesje!302