Ajax generation for image tree