I don't think the 10k resistor directly affects speed, even if its voltage varies in sympathy with the '5V' line. Tracing back from the 5V line (yellow wire), it connects via R11 (looks like 1k) to pin 11 of the IC, which is presumably putting out a PWM signal. An electrolytic cap (C8?) from the wire to ground smoothes the PWM signal. If R11 is indeed 1k then a 25k pot could perhaps be connected between the '5V' line and ground, and a speed control voltage could be taken from the pot wiper. This might or might not work, depending on the control input characteristics of the pump. It might be necessary to reduce the pot value, at the expense of a reduction in the max speed of the pump. (A 10k pot would give ~10% max speed reduction).