The key to differentiate between 这是哪（儿） and 这是在哪（儿） is to understand the different usages of the character '这'.
这 have several meanings, I just listed two of them relevant to this topic:
- referring to a person, thing, or place, like the word 'this' in English. For example, 这是我家。 means This is my home.
- used to emphasize 现在, like the word 'now' in English. For example, 我这就来. means I am coming now.
这是哪？, 这（subject）+ 是（verb）+ 哪（target）, simply means "where is it?".
这是在哪？, 这（intensifier like an adverb in English, modifying 是）+ 是（verb）+ 哪（target）, implies 现在是在哪, apparently the sentence omits a subject "我们". The complete sentence should be "我们这是在哪", and the equivalent sentence in English is "where are we now?"
In this case, I gather your friend asked this question in your moments of WeChat, where you might post some scenery photos. So, 这是哪("where is it") is more accurate here.
Some explanations on these sentences you quoted above:
这是（在）哪里？: This is the same as "这是（在）哪"，as talked above.
这是（在）哪儿？: This is the same as "这是（在）哪"，as talked above.
这里是（在）哪里？: 这里是哪里 == 这是哪里==这是哪（儿）， 这里是在哪里 is unnatural and it should be either 这里是哪里 or 这是在哪里. The difference has already been talked about.
这里是（在）哪儿？: 这里是哪儿==这是哪儿==这是哪里， 这里是在哪儿==这里是在哪里， which is unnatural and should be either 这里是哪儿 or 这是在哪儿. The difference has already been talked about.
PS: In this case, 这是在哪 could be short for 这是在哪里拍摄的 or 这是在哪里照的. But people usually won't apply the omission(just use the full version), because the short version "这是在哪" could mean differently as mentioned above. So, 这是哪 is better than 这是在哪，because 这是在哪 creates a bit ambiguity. It might be ok to put 这是在哪 here, but people need to think a bit to interpret what you mean is 这是在哪里拍摄的 (where had the photo been taken?). In practice, people really don't care that much. It might just be a little nitpick to determine whether 这是哪 or 这是在哪 should be used in this case. But natives would use "这是哪（儿）", "这是在哪里拍的？", "这是在哪里照的？" etc...