Seam Carver solution for images