Calculate width and height for panel
Implement CenterPanel
Some fixes