Changed the way the PImage is used and added some comments