update image margins and widths