Fix images download bug into automatic scan mode.
Improve download image algorithm.