Replaced db_clear with existence check on db values for album and photos