The image sizes vary depending on your targeting. Here are the ideal image sizes as well as aspect ratio for mobile and desktop targeting.
For Desktop - Image should be at least 360px (width) by 180px (height) with an aspect ratio of 2:1
For Mobile - Image should be at least 720px (width) by 240px (height) with an aspect ratio of 3:1
Larger images will be downsized and smaller images will be stretched depending on the size of the container.
For targeting Mobile and desktop users with different images within the same campaign, we recommend creating different locales for mobile and desktop users. Now, while setting up the web campaigns you would get options to use different images for each locale that you have set up.
For example, You can set up locale with "Web Push Subscription Status is True AND Mobile User is True" as a locale for your Mobile users and while creating the campaign choose an image with 3:1 aspect ratio within the message for the created locale.