Restructure cfg for Pillow