adds img boxes and margins