Image filter using threads