The method from psweb works quite well.
But I still have questions:
Is there a way to make this a script that creates a variable $device size so it can be applied to all photos?
/assets/images/$device-size/image
I would also like to apply this to the logo, dynamic slider and product photos(dynamic card).