Improving image preview mem management