X-ray computerized tomography (CT) is a 3D imaging technique that makes use of x-ray illumination and image reconstruction techniques to reproduce the internal cross-sections of a sample. Tomographic projection data usually require an initial relative alignment or knowledge of the exact object position and orientation with respect to the detector. As tomographic imaging reaches increasingly better resolution, thermal drifts, mechanical instabilities, and equipment limitations are becoming the main dominant factors contributing to sample positioning uncertainties that will further introduce reconstruction artifacts and limit the attained resolution in the final tomographic reconstruction. Alignment algorithms that require manual interaction impede data analysis with ever-increasing data acquisition rates, supplied by more brilliant sources. We present in this paper an iterative reconstruction algorithm for wrapped phase projection data and an alignment algorithm that automatically takes 5 degrees of freedom, including the possible linear and angular motion errors, into consideration. The presented concepts are applied to simulated and real measured phase-contrast data, exhibiting a possible improvement in the reconstruction resolution. A MATLAB implementation is made publicly available and will allow robust analysis of large volumes of phase-contrast tomography data.