[epg] refactor CalcuateLayout() into UpdateLayout() and the free item
memory stuff in it's own method