Clean the fish heads; remove the gills (you can ask the fish monger to do this for you). If the heads are rather large, you can chop them into halves.
Peel and thinly slice the shallots.
Crush, peel and finely mince the garlic (it's easier to peel garlic after crushing the cloves first).
Peel and grate the ginger.
If you want the chilies to bite but not scorch, slit them open lengthwise and scrape off the seeds (a trick I learned from Nigella Lawson).
Heat the cooking oil in a pot that should be wide enough to hold the fish heads in a single layer to ensure even cooking. Add the garlic, shallots, ginger and chilies. Cook until fragrant (about a minute over medium-high heat).
Add the fish heads in a single layer. Pour in about a cup of water, season with fish sauce or salt then bring to a boil. Cover and simmer for about 10 minutes (longer if they are rather large). The water need not cover the fish heads -- the heat from the steam is enough to cook them.
Turn up the heat to medium and pour in the coconut cream. Bring to a gentle boil. Continue cooking the fish, uncovered, for a few minutes. Taste the soup and add more fish sauce if necessary.
With a large spoon or spatula, lift the cooked fish heads and transfer to individual soup bowls. Pour the broth and spices over them and garnish with chopped green onions.