High Side PWM motor driving circuit
Using R6 as the pull-up on a P channel mosfet is not great for efficiency of switching at higher frequencies. If the gate capacitance of the mosfet is 1nF then this and a 10k resistor form an RC circuit with a time constant of 10 micro seconds - generally, as a rule of thumb 5CR is a good estimate of how long an open-collector (ULN2803) digital signal takes to collapse when subject to an RC circuit and this looks like about 50 microseconds.

This on its own limits the highest frequency to 20kHz and in reality I wouldn't go above 5kHz with this. Maybe reduce R to 1kohm for operation at 25kHz.

Regarding the flyback diode, if the motor is taking 5 amps peak then a conservative approach suggests using a 5 amp diode but, given that a 1A diode will take peaks much in excess of 5A, you have to decide how much you are pushing the device to destruction. Every PWM cycle could push a peak current of 5A into the diode. Read the data sheets.

I wouldn't use a 1N400x because it sails just too close to its limits. You also don't need a diode that's rated at 1000 volts either in this configuration - 50% more than the supply voltage will suffice for this application.