Refactor getting creating image url for S3