imageSegmentation was segfaulting, found a bounds checking issue and resolved it