wouldn't make this two calls to Amazon_S3_And_CloudFront wp_generate_attachment_metadata? Once when the filter is applied at the end of the wordpress original wp_generate_attachment_metadata and a second, this explicit one.