Fixed problem when deleting keywords with no pictures in database.