photo uploader/ajax fix

move photo uploading and removing into 'photo' class,
fixing configuration,
adding 'count' method for Database class,
init.php - add filters for overquoting (if magic_quotes_gpc is on),
Order class - add symbol escaping