php s3 query and page build