FIX: Ignore `allowlistgeneric` Onebox image sizes (PR #13240)

The size of an image contained within the preview pane of a Composer window may vary depending on the configuration of the browser displaying the Composer (e.g., dimension of browser window, zoom level, etc.).

Presently, the dimensions of the images from the browser creating the post containing the Onebox will be used to render the Onebox to anyone who views the post. It is safer to let the backend figure out the dimensions of the images. Therefore, exclude .onebox.allowlistedgeneric images from the list of image_sizes sent to the backend.

GitHub

@pmusaraj Your suggestion of fixing it on the client side was much cleaner than the way I was attempting to do it!

Can we try to avoid jQuery while we’re at it? (As mentioned in chat, and as the comment in line 771 says, ideally we wouldn’t do this here at all, but in the meantime we can at least reduce the jQuery footprint.)

Also, I don’t think it would hurt to apply this to all images inside oneboxes (i.e. not just allowlistedgeneric ones).

Just the minor jQuery note, otherwise looks good.