ui/expandgallery: add margin into calculation for opened space so we can add space around details