The Esc key isn't suppose to be the key to take photos by default. What may have happened is, the hot keys were changed due to installing another program that has the same or similar hot keys to Sims 4.
A few programs that are known to cause issue with Sims 4 are:
-- Gyazo - Screen Capture program that may use the same key combo as the Sims games. - If you have this program it may be best to uninstall it.
-- Action! Screen Recorder - Similar to Gyazo.
-- Skitch - Screenshot and photo editor for Mac that uses the same key combo as the Sims games. If you have this program, it's best to uninstall it or disable it.
-- Skype - A Instant messenger/video chat program may interfere with Sims 4.
-- Discord and it's overlay software - A VOIP (Voice over IP) program.
-- Parts of the video driver software that have to do with recording or streaming may cause issues with being able to open up the cheat console.
They may need to have their hot keys changed to a different key-combo or may need to be turned off or uninstalled if issues are severe. If you do not know how to use or change these programs listed above, go to their website to get more information. That is the best place to get help.
If the above doesn't help, please consider asking over at AHQ Sims 4 Tech Help -
https://answers.ea.com/t5/Technical-Issues-PC/bd-p/The-Sims-4