Soften the onions and garlic in cooking fat, over medium heat until softened
Add the port, broth or water, thyme
Bring to boil and reduce by half (it should take about 5 mins)
Put chicken livers, minced pork, onion mixture, gelatine (if using) and salt into a blender and mix until smooth-ish
Line a terrine mould with the ham, ensuring it over hangs on the sides, so you can fold it back on top
Put the mixture into the lined mould. If the top isn't completely covered, add 1 or 2 slices on top
Cover the dish with tin-foil and place the terrine in a dish, with boiling water. Place it in the oven, and bake it for 1h45 to 2h at 130 degrees, until the terrine detaches from the sides. I like my pate slightly pink, so it's more likely to be 1h45 for my taste.
Take out of the oven and leave it to set in the dish for a few hours (place in the fridge once it has cooled down a bit)
You can turn it over on a plate, but I prefer to leave it in the terrine dish, as it's easier to store in the fridge. It will keep fresh for 5 days in the fridge (though I have found it's fine to eat for a bit longer than that). It also freezes well.