update image margin