If I use that function the only thing that changes is the size, but not the file. What I want is to show the thumbnail file in mobile (lighter than medium) and the medium file in tablet and desktop.
I am not 100% sure but … if you set the sizes using that function and there is a Media Attachment available that matches it then WP may grab that file.