Fixing issue with undefined image