account for margin or borders for images