fix issue where images are undefined for logged in users