Perfectly scale and center images in beautiful grids