PHP seam carving with protected areas