Thanks Tristan, I thought as much.
Currently, I am adding them to a record set, then using the built-in function to sort them. It just seems an un-neccessary overhead for the server though. Fortunately, I am managing to run the script only occasionally - when a new web cam image or photo is...