server code fixed for salephoto