restful image gallery in Ajax with json