Bug 847060 - create and save a preview image during metadata parsing for...

......(cherry picked from commit 5a1ead9c8f831167fd86464d21eea310c7082112) with additional lint fixes