Go ahead. You could just add an else / else if case to this
, you shouldn't even need a dummy element. If you want you could even move this
check into the forEach and remove previews if they are disabled. The only thing I would check is if external images in documents are downloaded twice if the iframe is removed from the document in between, and decide if that's worth it. By default previews are only enabled on wifi, so it may be.