JS ONLY! Fix for recursive image handling