cleaning some code for v0.2
make sure at least one point is recorded
Added image cache to improve the performances