Systematic approach to image formation in digital holography