Refactored colocolized pixels image generation method
A new method for the generation of the image has been created to make the code more readable.