You can't "position" the output stream.
What i suggest you do is take the above code and place it in its own .aspx file named something like GenerateImage.aspx
Then, on the pages you want to use the above functionality setup an image control something like this:
<asp:Image src="GenerateImage.aspx" runat="server" />
You can then postion the Image where ever you want.
Read this if you want to know how to get a correct reply for your question:
Technical Editor for:
Beginning Visual C# 2008
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
Wrox Blox: Introduction to Google Gears
Wrox Blox: Create Amazing Custom User Interfaces with WPF and .NET 3.0