Complex sentence: Both panel paintings and gilded frames had a thin flat layer of gesso as part of their preparation, to which the "pastiglia" was added; it was then always gilded or painted, usually the former.
Split into simpler sentences: Both panel paintings and gilded frames had a thin flat layer of gesso as part of their preparation, to which the "pastiglia" decoration was added. It was then always gilded or painted, usually the former.