In my opinion, WordPress does a terrible job of supplying developers with functions for getting attachment image data.

Sometimes it’s nice to be able to get all the data available for an attachment image, and nothing like this is built into WordPress. This snippet will allow you to do just that. It will even give you all the different image sizes in a nice array.