Well... That's abit vague question...
This is how I'd do it if I were to build one from the scratch...
First, make the data source looking like this whether it is saved in the XML file, text file or database...
-- Title : Some picture title
-- Description : Description for this picture in case you want to display some length text
-- Source : Path/To/File.jpg
-- ExpireDate : 2/5/2009
#1. Load that data from the source and convert them all into an object(or an array)
#2. Feed the first element of that object into the function that loads image/displays title and description...
#3. Check the ExpireDate stored in that object to see if it has passed today's date or not...
If it has passed already, ask for the next object and repeat the validation process to filter out the unnecessary items...
CyanBlue