i am guessing that you are trying to make a system where your users can either upload or select an image (like an avatar on a forum system 🙂)
my suggestion is go ahead and look at your User CP > Edit Avatar section to see how you should set up your code..
then check out www.php.net for $_FILES(file uploads) and search around for help on such scripting
if you already have that part set up, then modify the selection part to enter the information into a database (i.e. fields image,type)(for type URL, make image the full http:// URL, and for type upload, make it just the name of the uploaded image... and echo your image out using the type field)