Scaling, proximity, and optimization of integrally convex functions