changing the way the program handles images and trying to be more efficient on memory