Added functionality to automatically display more panels in 1 frame