Created the compile spritesheets function.