No, obviously it doesn't resize it before downloading - it's impossible. Look at the chaining, first - download, second - resizing. If you want to get a smaller images, you should ask for a smaller images if you have such a chance, of course. You can write graceful degradation: if the file size is bigger than limit, then just don't download it and display some placeholder instead. It can be implemented by checking content length at first:
URL url = new URL("http://server.com/file.png");
URLConnection urlConnection = url.openConnection();
urlConnection.connect();
int file_size = urlConnection.getContentLength();
Taken from here How to know the size of a file before downloading it?