script for making sprite from layers