Hello,
Yes i agree with this last post. If you want to limit the power dissipation in the 7805 put a resistor in series with the input, not the output. That will push some of the power out of the 7805 and into the resistor instead. The limit, however, should be set so it is still high enough to allow proper charging, which could mean a full 500ma. If i remember right, the 7805 needs at least 7v input (it could be 7.5v though) so that means we want to drop 5 volts (12-7) and at 500ma that means we need a 10 ohm resistor. The power in the resistor will be 2.5 watts so the 10 ohm resistor should really be a 5 watt device, 10 watt will stay cooler however, and anything greater than 10 watts all the better.
The 7805 will have about 2 volts across it, at 500ma that will be 1 watt, so the device may be able to take it without a heat sink but im sure a small heat sink would be a good thing to add. 1 square inch on top side means 1 square inch on bottom side so that's not too bad, maybe around 38 degree C temperature rise.
This can also be done with a string of 1N4001 or similar diodes, and the power will be nicely distributed among all the diodes.
To do this in a small space, we have to look at the total power loss required. For a 7v drop at 500ma that means we have to loose 3.5 watts, which is a fair amount of power in a small space. That's with a purely linear circuit, so this means we probably have to go with a switcher. A switching circuit could do this and loose only about 0.5 watt and that would stay much cooler even in a smaller space. This would be a simple buck regulator. Check out the National line of Simple Switchers, of which one comes with a set output of 5v so you dont even need any resistors.