Fixed problem with cells at image edges.