Fix #8858 : handle $wgImageLimits changes correctly