High-resolution imaging mass spectrometry of large biological samples is the goal of several research groups. In mosaic imaging, the most common method, the large sample is divided into a mosaic of small areas that are then analyzed with high resolution. Here we present an automated alignment routine that uses principal component analysis to reduce the uncorrelated noise in the imaging datasets, which previously obstructed automated image alignment. An additional signal quality metric ensures that only those regions with sufficient signal quality are considered. We demonstrate that this algorithm provides superior alignment performance than manual stitching and can be used to automatically align large imaging mass spectrometry datasets comprising many individual mosaic tiles.