While PCA learns a subspace that captures the variations of the data, it assumes the collected data is well preprocessed(i.e., the pictures for faces are aligned by eye corners), this usually introduces a huge mount of manual labor for human. While people have been developing automatic eye alignment tools for such purpose, detecting eyes with robustness and accuracy is still an open problem for research. We propose to learn PCA while at the same time eliminating the mis-alignment in the data. We formulate the PCA model in a generative framework, and introduce the mis-alignment as a hidden variable in the model. A novel Variational Message Passing  update rules is then derived to learn the parameters. The experiments show that the performance of PCA based face recognition is significantly improved by our algorithm when misalignments exist.