We consider the emergence of edge states in a finite optical lattice and show that the boundaries of the lattice play a decisive role for their location in the corresponding energy spectrum. We introduce a simple parametrization of the boundaries of the optical lattice and demonstrate the existence of an optimal choice of the values of the parameters which leads to an approximate restoration of chiral symmetry. A crucial property of this optimization is the suppression of tunneling between next-nearest-neighboring wells of the lattice. This in turn allows the mapping of the optical lattice setup to a finite SSH model. The topological character of the emerging edge states is discussed.