Forgot to answer your question.
You can get the category id from the route data in the view like this:
Url.RequestContext.RouteData.Values["categoryId"]
It would be best to change/swap the picture when you prepare the model but you can also do this in the _ProductBox.cshtml. Simply call you function in the view and change the picture there.