Fix auto resize in flash mode, issue #1053.
Merge pull request #1055 from xxvholic/master

Fix auto resize in flash mode, issue #1053.