Calculate image sizes