Seam Carving first implementation