Fixed major memory leaks (leaked the image... TWICE)