Two variants of a picture database initialization routine
For me, there's two main things that drive extracting into a function.


Is there scope for reusing the functionality?
Would a function make the code easier to follow?


Looking at your code, it doesn't seem like the functions that you've implemented have much scope for reuse.  Whilst they could make your code easier to follow, I don't think they do, primarily because the names don't really describe what they do.  I find getting names right to be hard work, but well named methods make code a lot easier to follow.

Your method names that you've introduced are:

db_create_helper
    finish_initialization
    write_to_file


They don't tell me anything about what it is you're expecting the methods to do.

An alternative might be something like this:

initialize_db_file
    build_db_header
    write_db_header
    write_db_metadata


These names aren't perfect either, I don't really know what 'metadata' represents and if it should really be part of the header, which is why I've split your write_to_file in to two, however I've tried to name the methods so that they convey what it is I think the methods are doing.  This makes the top level method more meaningful, describing the process of initializing the db file.

As far as method length goes, methods that are too long are a red flag, because they usually mean that too much is being done in one place and the method is likely to be hard to follow.  However, I'm Ok with one line methods, as long as the name for the method actually conveys the intent better than the line it hides.