A man who found a painting at a tip was able to find out it was actually centuries old and sold it for a lot of money.