Automatic sprite creation using php