All images are flawed, no matter how good your lenses, mirrors etc. are. Especially in the hard X-ray regime it is challenging to manufacture high quality optics due to the weak interaction of multi-keV photons with matter. This is a tremendous challenge for obtaining high resolution quantitative X-ray microscopy images. In recent years lensless phase contrast imaging has become an alternative to classical absorptionbased imaging methods. Without any optics, the image is formed only by the free space propagation of the wave field. The actual image has to be formed posteriori by numerical reconstruction methods. Advanced phasing methods enable the experimentalist to recover a complex valued specimen from a single or a set of intensity measurement. This would be the ideal case - reality teaches us that there are no ideal imaging conditions. Describing, understanding and circumventing these non ideal imaging conditions and their effects on X-ray near-field holographic (NFH) imaging are the leitmotifs for this thesis. In NFH the non ideal conditions manifest themselves in the illuminating wave field or probe. The probe generally does not satisfy the canonical assumptions of fully coherent and monochromatic radiation emitted by a point source. The main results of this thesis are compiled as a collection of publications. An approach is shown to reconstruct the probe of a X-ray nano-focus setup by a series of measurements of the probe at varied Fresnel number. The following chapter presents a study concerning the reconstruction efficiency in terms of resolution for near- and far-field based lensless imaging. In the following, the reconstruction scheme for the probe is extended to incorporate the effects of partial coherence in the near field. This enables the recovery of the modal structure of the probe which yields a full description of its coherence properties. Giving up the assumption of temporal stability due to the stochastic pulses, delivered by X-ray free electron lasers, the reconstruction of probe and specimen must be achieved from a single shot. A suitable scheme for this purpose is proposed in this work.