I found the answer myself.
The problem was in the source image. It seems that the first 1px is slightly different than the rest...
changing this line works:
CGImageRef imageRef = CGImageCreateWithImageInRect([image CGImage], CGRectMake(5, 0, 1, image.size.height));
Basically leaving a 5px security zone ;) and then taking 1px ...