subtracting median from image