How many bytes of memory is used just to "acknowledge" that a certain file is a .jpg?
Depends on how accurately you want it to be. 

If you trust the extension then all you need is the 4 last characters in the file name (32 bits)

If you trust the magic header number then you need to check the file starts with 3 bytes ff d8 ff (24 bits). Though other file types have different sizes of magic number. There is a (non-exhaustive) list of them on wikipedia.

If you want to make sure the file is an actual image then you need to actually decode it. Here the size depends on the file size.