Moved PDO to library, JS improvements, store photos in DB