Perfectly scale and center images