fixed cascading deletes for gallery images