Yes, with PHP/JavaScripts (or even both)
You will must to read the image size (with a software like GMagic in PHP) , and also autosubmit via JavaScript your website size, lol
And then compare it

It can be done, and it's easy , sorry for not having inaf nervs for writing the code for you