Question: how to transfer photos from locked iphone to computer?
Answer: Connect iPhone to the computer you previously synced with.
Open iTunes. ... 
When it's done, click Restore iPhone button and the passcode should be removed at this point.
You should now set up the device. ... 
Select your iPhone in iTunes and choose the most relevant backup to restore from.