What do you mean 'learn the hard way'?
Exactly what Gfk said. Simply calling freeimage by itself will not free the image handle, you should zero that manually. I learned the hard way because i was not doing this when i first started with blitz. After my program ran for awahile images started becoming corrupt and bizarre looking. So i had to go through a ton of code to correct my error, pain in the arse it was :)
As for using EndGraphics() i personally have never had a need to use it. But i did do a test: I Loaded up an image into gfx_image then called EndGraphics() then printed gfx_image... the image handle was still being retained.
Given the above i don't think EndGraphics() will do exactly what you are looking for. You would still need to set all your image handles to zero/null manually to be sure no weirdness happens after the prgram runs awhile.