Seam carving implemented but fails