fixed bug that was deleting image instead of tmp