[SNAP-41] Median filter gives wrong results