Move geometry parsing to create_image_surface()

Define create_image_surface(char *) that returns a new surface based on
the passed geometry.
Move variable declarations to top

C99 is much more flexible with where declarations can occur, but let's
stick with with the traditional constraint of putting them at the top of
a function for better compatibility.
Fix typo in comment