adjust image size and margin