Support restore picture to original.
Fixed calculate neighbours.