generate square image with drawInRect: method

Sometimes, I found that squareImage generation don't work properly in my project.

http://stackoverflow.com/questions/506622/cgcontextdrawimage-draws-image-upside-down-when-passed-uiimage-cgimage