IPhone 4 not enough local storage available to purchase app?

I'm trying to download an app that says it is 398 MG and when I click Buy, a window pops up that says I don't have enough local storage. When I go to settings, it says I have 516 MG available. Wouldn't 516 be enough? How can I fix this? Do I have to delete things? I did delete a lot of pictures, but it didn't seem to work.

Restart the phone and your local storage space will be updated, then you can download the app

Unload all your pictures and videos to the computer.

Buy the app via iTunes on your computer, then sync your iPhone with your computer.

When you download software directly to your iPhone, it downloads the installation file, then unpacks it, installs on your device, then deletes the installation file if everything goes well. This basically requires about 2.5 times the space of the final app. Hence, for a 400MB file, you basically need about 1000MB (1 gigabyte) of free space on your iPhone.

When you download iPhone apps on your computer, the downloaded installation file is unpacked on your computer, then the new app is copied to your iTunes library; the old app is moved to the Trash bin.

I'd delete apps that you don't use. Try again after 1GB has cleared up.