Note: linked (remote) listing photos will contain http:// or https:// full URLs as their file_name. Locally stored photos will return their file name only with no path information. Do not echo or print any results from your script except for debugging purposes, that will otherwise break the expected json return codes in the Media widget making it appear broken. Send any absolutely necessary output to the OR activity log instead. Return NULL in your function when completed.