To be honest, thats the exact opposite of what you should be doing. To keep code managable and readable its better to split it up into distinct classes and methods. By throwing everything into a singel method it makes it very hard to track down errors or make changes to parts of the code (as you are finding out now). You woul dbe better to write a class that handles the functionality, pass the image to it and have it return the resulting image. Then inside that class you split up the process into distinct methods.
I'll go over the code in your project and see if i cant hash it together into a more OO friendly structure for you :)