be a bit smarter about adjusting image sizes