Please consider including this modification to the CDN functionality:

It makes the CDN URL rewrite persistent across the site. This avoids the same images being downloaded multiple times as currently happens if you use additional CDN CNAMES.

(It uses SHA1 to compute a hash modulo for URLs to always use the same CDN CNAME.)

Please contact me if you have any question!