Add option to return double output image for rank filters