This is one of those problems that seems like it should have a simple solution, but really doesn't. There are options, they're just not easy.
At least, from what I can see.
Even if you could detect browser width in PHP, you wouldn't want to. What if they made their browser bigger (i.e. rotated their device)? PHP is gone by that point, and can't add it back anymore.
There is a clever technique I read about where you use the new HTML5 image srcset to still serve an image at mobile resolution, but a very small one. However since you're using a slider, which I presume means a plug-in, you probably don't have that flexibility.