try to make png image loading more robust for bug #2425