Tried an new image and a slightly different method for calculating curves. Still no luck.