Fix save of layer with a min resolution bigger than 2.5

Fix the algoriuthm to know which layer is cacheable