Add PDO, new structure for images, and many little fixes.