AE-4 Added gallery elements and changed SQL