Better photos start before you shoot. One place to stand for the main keep of Osaka Castle, away from the crowd.
Most maps pin the thing you want to photograph. This one shows where to stand. Position is accurate to about 10 metres, so look around you before you raise your phone.