How are image files, sounds, data, etc. compiled/linked in to a single file?
A file is just a file. Any given sequence of bytes can be interpreted as instructions for the CPU, pixels of a graphics file or anything else. And a file can contain sequences of bytes that should be interpreted as instructions and sequences of bytes that should be interpreted as graphics. If the executable part has been written correctly, it will never try to interpret the graphics part of the file as CPU instructions; when it needs to refer to the graphics, it knows where they are in the file (and, hence, the memory image) and starts reading from the appropriate address. In principal, the operating system doesn't even need to know it's doing this.