toImage improvement
config first
Merge pull request #684 from lavrton/toImageImprovement

toImage improvement