Fix auto resize in flash mode, issue #1053.