Soak bacalao in water ovenight, changing water once or twice to remove excess salt. Drain and remove bones.
Boil water, put in tomatoes whole. When tomatoes are softened, peel off skin, remove seeds, chop and set aside.
In a large casserole, heat olive oil. Saute garlic but do not brown.
Add chopped onions and lower the heat stirring frequently till onions are transparent.
Add chopped tomatoes, celery, carrots, parsley, tomato sauce and tomato paste. Simmer over very low heat for an hour.
In an ovenproof dish put a layer of sauce, top with bacalao and pimientos.
Sprinkle almonds and biscocho and top with more sauce.
Layer ingredients in this manner then bake at 350 °F for 30 minutes.