Avoid JS errors without images