Fixed images and some other algo bugs