handle margins for tiles