Undoing pixels gives more pixels back than intended