spring servlet version of the server side of the gallery app