Set maximum size to layer box