adds dependent destroy in Gallery class