Stepper misses steps on low speeds

Can't see the resistors in that photo. It is anyone's guess what the actual current limit setting might be.

But the photo brings up another problem. Breadboards are designed for low power logic circuitry, and the tracks will burn if subjected to motor currents.

In turn, that leads to intermittent connections, which if wiggled while the power is on, will instantly destroy the A4988 driver.

Either solder the motor wires directly to the driver, or use screw terminals if provided, or solder everything to a PCB protoboard, perhaps like the one shown below (from Adafruit), which can handle motor currents.

protoboard