Update img to auto determine horizontal margin.