Working towards modularizing image processing per #283 , but the bunch of code in template.rb is proving a real challenge to modularize in any way beyond copy/paste...hmmm