fixed some issues for working with image sizes and S3