CImgFilter: fix copy-paste bug + add checks