updated code for onionskinning images