update image margins