The task of optimization of phase masks for broadband diffractive imaging to minimize chromatic aberrations and to provide given value of Depth of Focus (DoF) is considered. Different schemes of multilevel phase mask (MPM) forming by combining pixels of two Fresnel lenses are analyzed. The Fresnel lenses are calculated for the same focal distance but for very different wavelengths. A possibility of adding to the optimized mask a cubic component is taking into account as well as usage of discrete phase masks with optimized number of levels. It is shown that the proposed approach in the combination with inverse imaging allows to significantly increase image quality for a focus distance in comparison to refractive lens-based optical systems. Moreover, it is shown that by changing of aforementioned parameters it is possible to increase or decrease DoF value depending from a given goal of optimization. It is demonstrated by numerical analysis that the proposed approach significantly increases robustness of designed MPM to Gaussian additive noise in MPM introduced due to fabrication errors.