Make itemsPerRow dynamic based on view size