Image download size validation
Some cosmetic changes too.