Improve image helper to match old behavior