Refactor render code into callable function

I wanted to separate the rendering from ActionController::Renderers to make it easier to return the actual image so it can be saved in a cache, stored in file, attached to email, etc.