This is a little weird - why exit, why not just fail?  And why *not* when the image upload fails?