directory cleanup, further database work

delete unused images, update history and help page,
add proper code to the PDO interface.