No route matches [GET] "/galleries/40/1.jpg"
Try running rake routes for more information on available routes.
rake routes