fixed thumbnail and img saving to only save if img does not already exist