To vary the size of the image upload like we can set the image size range of values.if 25mb is the size limit then it will show pop up if we upload a file more than that.
Here we used the JS code:
const oFile = document.getElementById("fileuploadfield").files[0];
if (oFile.size > 26214400) // 25 MiB for bytes.
{
alert("File size must under 25MB");
return;
}