In a pinch, you can use Nitrogen to dynamically serve content other than HTML. The image to the right is served as raw data from a Nitrogen module.
View the source code of demos_contenttype_image.erl to see how it's done.
View Module Source
Released under the MIT License.