The reason why homes are cheaper on the gallery is because the lot value isn't counted there. Most smaller lots are the same price but the bigger ones vary - in one place a 30x40 can be 3.000 simoleons, in another it can be 5.500 - so placing a home from the gallery on a lot in the game might result in a different value/cost. That's why it's left out in the gallery. It is also possible to place a small home on a much bigger and more expensive lot, which changes the overall cost.
The pictures in this thread will illustrate this nicely: http://forums.thesims.com/en_US/discussion/839008/maps-of-the-sims-4