Command line image sprite generator in PHP