Code 12 means the battery was disconnected within 255 starts ago. No big deal, except that if your throtle body is dirty, and your PCM has lost it's learned Idle Air Control (IAC) steps value because of the battery disconnect/dead issue, the engine often won't get enough air to idle. My suggestion is to clean the throttle body bore and blade with some carb spray and an old toothbrush. This is a normal 15K mile maintenance procedure anyways. If it's never been cleaned, you will be amazed at the crap gumming up the blade where it seats to the bore! Cleaning it allows the normal air flow around the blade, that the base memory IAC steps are set for.
The code 24 is for the Throttle Position Sensor (TPS). Most likely, your TPS is defective. It is a very common failure part, especially if it gets wet. Check the wiring to it to make sure a rodent hasn't chewed the wiring, if it's OK, replace the TPS. It is one of the main inputs to the trans and engine controllers.
The fuel filter and pump won't be the cause if it runs when you keep your foot on the gas. These would more likely show up as a sag or loss of power under heavy load or accelleration, when they are first starting to plug up or fail.