Improve the preprocess for image snippets.