Add bad image detector
Replace hardcoded channel with function argument