Don't delete all images. Keep all old images, change avatar. Store images sequentially using numeric filenames and keep an avatarid in the users table.