I'll say that if you get the D40, take a closer look, it is a great entry level DSLR a bit old technology by current standards, you may outgrow it quickly , disadvantages I see with the D40 are the small viewfinder, the inability to handle ISO 800 or higher without noticeable noise and only 3 autofocus points

if the photo is taken in Raw the differences between both images is easy to correct