imagefilter: use one try/catch block