refactor @pictures in controller to db