Can someone explain why we say there were 3 slices or there was a slice (imperfect) here? I know this is what I'd say in English but I have zero grammatical knowledge so I dont know why other than it sounds right! I guess the perfect would be "there has been" or "there have been". As far as my French goes I thought the imperfect was for ongoing or repeated events, for wishes, emotions, opinions or descriptions of the past?
"Il y a" and "there is/are" describe a kind of state, rather than an action or event.
"There were 3 slices" naturally translates to "il y avait trois tranches".
"Il y a eu trois tranches" in compound past is also possible, but it more precisely tells you that at one point in time, 3 slices were present, but they no longer are.