Forgot code to access phone. Any way to recover pictures on it?
If it's actually safely built, then no. If the device isn't running the latest software, it's possible that you could use a security exploit to delete the lockscreen settings database, but otherwise you're SOL, I'm afraid.

If you backed the photos up via Google Photos, they might still be there. Also check any other cloud storage or backup services you may have used.

As a last ditch resort, I don't believe there's an option in a stock configuration of Android that locks you out of your phone after so many attempts, so really all you're limited by in getting into it, is your patience of trying every possible combination.