Local variability causes adaptive spatial integration