My guess is that a Muslim baker wouldn't offer graven images to anyone.
Hell, just to spice things up, let's say that he's a Cafeteria Muslim - picking and choosing which religious precepts to honor or observe, and which to ignore - and who routinely affixes imagery to the top of cakes...
But the request for an image of Muhammed on the cake is The Last Straw, and One Step Too Far into the Land of Wickedness, and he can't bring himself to go that far against his faith and his people, and he refuses.
Akin to a Catholic who routinely bakes and decorates cakes for Gays but who refuses a customer order for a cake when he learns that the cake is to feature an image of a fully-clothed Virgin Mary getting gangbanged under her skirts by all twelve Apostles.
People have their limits, and so should The Law, in this context.